package com.diver.flinkdemo.mapper.mysqlMapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.diver.flinkdemo.entity.xxt.Message;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by wenjun on 2018/7/12.
 */
@Mapper
//@Component
public interface MessageMapper extends BaseMapper<Message> {

    @Select("select * from message where student_card_id=#{studentCardId} and delete_flag=0 and is_read=0 order by push_time desc")
    public List<Message> queryMessageByStudentCardId(String studentCardId);

    @Delete("delete from message where student_card_id=#{studentCardId}")
    int delByStudentCardId(String studentCardId);
}